#include<stdio.h>

#include<stdlib.h>
//void test(int* arr)
//{
//	printf("%d\n", strlen(arr));
//}
//
//int main()
//{
//	int arr[10] = { 0 };
//	test(arr);
//	return 0;
//}



int removeDuplicates(int* nums, int numsSize) {
    int* arr = (int*)malloc(sizeof(int) * (numsSize + 1));
    if (arr == NULL)
    {
        perror("arr");
    }
    int* arr1 = (int*)malloc(sizeof(int)*(numsSize));
    if (arr1 == NULL)
    {
        perror("arr1");
    }
    int i = 0;
    int str = 0;
    for (i = 1; i <= numsSize; i++)
    {
        if (arr[i] != nums[i - 1])
        {
            arr1[str] = nums[i - 1];
            str++;
        }
    }
    memcpy(nums, arr1, sizeof(int) * str);
    free(arr);
    free(arr1);
    arr = arr1 = NULL;
    return str;
}

int main()
{
    int arr[3] = { 1,1,2 };
    removeDuplicates(arr, 3);
}
